exports.deleteCategory = (req,res) => {

    var bodyParams = req.routeInfo.bodyParams;

    //查询该分类下是否有接口
    var sql = "select d_id from docs where d_dcid = " + bodyParams.dc_id;

    sqliteDb.all(sql,function(err,data){

        if(err){
            return RES.errorResponse(res,"抱歉，文档分类删除失败");
        }

        if(data.length > 0){
            return RES.errorResponse(res,"请先删除该分类下的接口，然后在删除分类");
        }

        //新增文档分类
        sql = "delete from docs_category where dc_id = " + bodyParams.dc_id;

        sqliteDb.run(sql,function(error){

            if(error){
                return RES.errorResponse(res,"抱歉，文档分类删除失败");
            }

            return RES.successResponse(res);

        });
       

    });

    

 }